import {Injectable} from '@angular/core';
import {CommHttpService} from '../../../core/comm.http.service';
import {SERVERS_NAME} from '../../../config/config';
import {HttpService} from '../../../core/http.service';

@Injectable()
export class SystemPublishService extends CommHttpService {

  protected preUrl = `${SERVERS_NAME.INSTITUTION_SERVER}ins/`;
  protected platUrl = `${SERVERS_NAME.SECURITY_SERVER}sys/`;

  constructor(
    protected http: HttpService
  ) {
    super(http);
  }

  /**
   * 获取字典数据
   */
  getDictApi(data) {
    return this.http.post(data, `${this.platUrl}dictionary/page`);
  }

  /**
   * 获取部门名称
   */
  getDeptListApi() {
    return this.http.get('', `${this.platUrl}dept/list`);
  }

  /**
   * 获取教师列表
   */
  getTeacherListApi(data) {
    return this.http.post(data, `${this.platUrl}teacher/list`);
  }

  /**
   * 获取班级列表
   */
  getClassListApi(data) {
    return this.http.post(data, `${this.platUrl}classes/findAll`);
  }

  /**
   * 获取当前用户的部门领导
   */
  getCurrUserLeaderApi() {
    return this.http.get('', `${this.platUrl}dept/getCurrentLeader`);
  }

  /**
   * 暂存制度
   */
  stageInstitutionApi(data) {
    return this.http.post(data, `${this.preUrl}stage`);
  }
}
